import request from '@/utils/request'

//列表
export function listholiday(query) {
  return request({
    url: '/system/holiday/list',
    method: 'get',
    params: query
  })
}
//详情
export function getholiday(id) {
  return request({
    url: '/system/holiday/' + id,
    method: 'get'
  })
}

//新增
export function addrule(data) {
  return request({
    url: '/system/rule',
    method: 'post',
    data: data
  })
}

//修改
export function updateholiday(data) {
  return request({
    url: '/system/holiday',
    method: 'put',
    data: data
  })
}
//删除
export function delHoliday(id) {
  return request({
    url: '/system/holiday/' + id,
    method: 'delete'
  })
}

export function listMemberRegion(query) {
  return request({
    url: '/system/region/addList',
    method: 'get',
    params: query
  })
}
export function listMemberStore(query) {
  return request({
    url: '/system/store/allList',
    method: 'get',
    params: query
  })
}
// export function listtechnicianList(query) {
//   return request({
//     url: '/system/item/technician/technicianList',
//     method: 'get',
//     params: query
//   })
// }
export function listtechnicianList(query) {
  return request({
    url: '/system/technician/normalList',
    method: 'get',
    params: { ...query, pageSize: 10000 }
  })
}
//新增休假列表
export function addHoliday(data) {
  return request({
    url: '/system/holiday/addPc',
    method: 'post',
    data: data
  })
}

// 判断休假时间天数
export function holidayCheckLeaveDays(params) {
  return request({
    url: '/system/holiday/checkLeaveDays',
    method: 'get',
    params
  })
}



// 判断休假时间天数
export function holidayPut(data) {
  return request({
    url: '/system/holiday/put',
    method: 'put',
    data: data
  })
}

export function getUserByRole(params) {
  return request({
    url: '/system/holiday/getUserByRole',
    method: 'get',
    params
  })
}